
const express = require('express')
const app = express()

app.listen(8888, () => {
  console.log('8888ok')
})

app.get('/', (req, res) => {
  res.redirect('https://www.baidu.com')
})

app.get('/index', (req, res) => {
  res.send('是是是index')
})

app.get('/detail', (req, res) => {
  res.send('详情')
})
app.get('/list', (req, res) => {
  // res.sendFile('C:\\Users\\任帅\\Desktop\\http\\express\\1.txt')
  res.sendFile(__dirname + '/1.txt')

})

console.log(__dirname)
